package com.smsclient.controller;

import com.smsclient.model.SMSCheckVo;
import com.smsclient.model.SMSModel;
import com.smsclient.response.Response;
import com.smsclient.service.SMSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/SMSApi")
@Api(value = "/SMSApi", description = "短信接口api")
public class SMSApiController {

    @Autowired
    private SMSService smsService;

    @PostMapping( "/sendSMSDatas")
    @ApiOperation(value = "/发送短信接口",notes = "支持单条/多条短信发送")
    public Response sendSMSDatas(@RequestBody SMSModel smsModel) throws Exception {
        return Response.succeed(smsService.sendSMSDatas(smsModel));
    }


    @PostMapping(value = "/checkSmsStatus")
    @ApiOperation(value = "查询短信发送状态",notes = "查询短信发送状态")
    public Response checkSmsStatus(@RequestBody SMSCheckVo checkVo) throws Exception {
        return Response.succeed(smsService.checkSmsStatus(checkVo));
    }


}
